package cn.ggy.service;

import cn.ggy.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
    public void getUser() {
        userDao.getUser();
    }

    @Override
    public void getMsg(String name, int age) {
        System.out.println("我叫"+name+",今年"+age+"岁了");
    }

    @Override
    public int getMoney(int age) {
//        System.out.println(1/0);
        System.out.println("计算年薪!!!!");
        if (age<2){
            return 20;
        } else

        return 50;
    }
}
